home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / Color Window Demo / update.c < prev   
Encoding:
C/C++ Source or Header  |  1990-01-31  |  832 b   |  24 lines  |  [TEXT/KAHL]

  1. #include "my color.h"
  2. do_update(the_event)
  3. EventRecord    *the_event;
  4. {
  5. Rect            erase_rect;
  6. CWindowPeek        this_window;
  7. CWindowPtr        active_window;
  8.  
  9.     GetPort(&savedPort);                            /* SAVE THE CURRENT P0RT    */
  10.     active_window = (CWindowPtr)the_event->message;    
  11.     SetPort((GrafPtr)active_window);                /* SET PORT TO THE ONE NEEDING UPDATING    */
  12.     this_window = (CWindowPeek)active_window;
  13.     erase_rect = active_window->portRect;
  14.     erase_rect.bottom -= (BAR_WIDTH + ONE_PIXEL);    /* Don't erase the scroll bars. If you do, they will flicker terribly */
  15.     erase_rect.right -= (BAR_WIDTH + ONE_PIXEL);
  16.     BeginUpdate(active_window); 
  17.     EraseRect(&erase_rect);
  18.     TEUpdate(&active_window->portRect, this_window->refCon);
  19.     DrawControls(active_window);
  20.     DrawGrowIcon(active_window);
  21.     EndUpdate(active_window);
  22.     SetPort(savedPort);        /* set port to original port */
  23. }
  24.